package com.atguigu.spzx.service.exception;

import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;

/**
 * @author wx
 * @version 1.0
 * @description: TODO
 * @date 2024/11/6 14:20
 */
@Data
public class GuiguException extends RuntimeException {
    private Integer code;
    private String message;
    private ResultCodeEnum resultCodeEnum;

    public GuiguException(ResultCodeEnum resultCodeEnum) {
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
        this.resultCodeEnum = resultCodeEnum;
    }

    public GuiguException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
